package fr.playsoft.psas;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import fr.playsoft.psas.listview.PullToRefreshActivity;
import fr.playsoft.psas.listview.PullToRefreshActivity2;
import fr.playsoft.psas.media.ZXingCamera;
import fr.playsoft.psas.parcel.ParcelSample;

public class PSASActivity extends ListActivity {
    
	public static final String[] NAMES = {
		"Carrousel Top",
		"Carrousel Bottom", 
		"Map Location", 
		"Map Route",
		"SFR - xiti tag", 
		"Horizontal Pager", 
		"View Flow Pager", 
		"Command popup",
		"Activity info",
		"Remote image gallery",
		"Fake Action sheet",
		"Swipe ImageView",
		"Pull to refresh listview",
		"Pull to refresh listview 2",
		"ZXing Camera sample",
		"Parcelable sample"
	};
	
	/** Called when the activity is first created. */
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
				
		// Create an ArrayAdapter, that will actually make the Strings above
		// appear in the ListView
		this.setListAdapter(new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, NAMES));
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		Intent intent = null;
		switch (position) {
		case 0:
			intent = new Intent(this, CarrouselTop.class);
			break;
		case 1:
			intent = new Intent(this, CarrouselBottom.class);
			break;
		case 2:
			intent = new Intent(this, MapLocation.class);
			break;
		case 3:
			intent = new Intent(this, MapRoute.class);
			break;
		case 4:
			intent = new Intent(this, SFRActivity.class);
			break;
		case 5:
			intent = new Intent(this, HorizontalPagerAct.class);
			break;
		case 6:
			intent = new Intent(this, FakeView.class);
			break;
		case 7:
			intent = new Intent(this, CommandPopup.class);
			break;
		case 8:
			intent = new Intent(this, ActivityInfo.class);
			break;
		case 9:
			intent = new Intent(this, RemoteGallery.class);
			break;
		case 10:
			intent = new Intent(this, FakeActionSheet.class);
			break;
		case 11:
			intent = new Intent(this, SwipeImg.class);
			break;
		case 12:
			intent = new Intent(this, PullToRefreshActivity.class);
			break;
		case 13:
			intent = new Intent(this, PullToRefreshActivity2.class);
			break;
		case 14:
			intent = new Intent(this, ZXingCamera.class);
			break;
		case 15:
			intent = new Intent(this, ParcelSample.class);
			break;
		default:
			break;
		}
		if(intent != null)
			startActivity(intent);
	}
}